package summit.tests
{
import flash.events.Event;

import summit.basecamp.helpers.CompanyHelper;
import summit.data.AccountToken;
import summit.events.BasecampAPIEvent;
import summit.tests.tools.SummitTestContainer;

public class CompanyHelperTests extends SummitTestContainer
{
	private var _companyId:String;
	
	public function CompanyHelperTests(token:AccountToken)
	{
		super(token);
	}
	
	override protected function self_CompleteInit(e:Event):void
	{
		_companyId = this.projectXML.company[0].id;
		super.self_CompleteInit(e);
	}
	
	public function readTest(context:Object):void
	{
		super.initializeLoader(super.loader_OKComplete);
		loader.load(CompanyHelper.read(_companyId));
	}
	
	public function listTest(context:Object):void
	{
		super.initializeLoader(loader_OKList);
		loader.load(CompanyHelper.list(projectId));
	}
	
	private function loader_OKList(e:BasecampAPIEvent):void
	{
		super.initializeLoader(super.loader_OKComplete);
		loader.load(CompanyHelper.list());
	}
	
}
}